import request from '@/utils/request'

export function login(data) {
  return request({
    url: 'login',
    method: 'post',
    data
  })
}

export function code() {
  return request({
    url: 'verification/code',
    method: 'get'
  })
}

export function getInfo() {
  return request({
    url: 'user/info',
    method: 'get'
  })
}

export function updatePsd(data) {
  return request({
    url: 'user/updatePsd',
    method: 'post',
    data
  })
}

export function getRoleLists() {
  return request({
    url: 'role/roleLists',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: 'logout',
    method: 'post'
  })
}

export function getUserLists(data) {
  return request(({
    url:'user/lists',
    method:'post',
    data
  }))
}

export function saveUser(data){
  return request(({
    url:'user/save',
    method:'post',
    data
  }))
}



export function userDeptLists(data){
  return request({
    url: 'dept/findTreeLists',
    method: 'post',
    data
  })
}

export function del(id){
  return request({
    url: 'user/del/'+id,
    method: 'get'
  })
}

export function deleteUser(data){
  return request(({
    url:'user/removeBatchByIds',
    method:'post',
    data
  }))
}

export function findUserById(id){
  return request({
    url: 'user/findById/'+id,
    method: 'get'
  })
}

export function changeUser(id){
  return request({
    url: 'user/changeUser/'+id,
    method: 'get'
  })
}


export function findMenus(){
  return request({
    url: 'index',
    method: 'get'
  })
}
